﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace Sherwood.SignOn.Client
{
    /// <summary>
    /// Example implementation of a SignOut handler which removes user sessions
    /// </summary>
    public class SignOutHandler : IHttpHandler
    {
        #region IHttpHandler Members

        public bool IsReusable
        {
            get { return false; }
        }

        public void ProcessRequest(HttpContext context)
        {
            if (context.Request != null && context.Request.QueryString != null)
            {
                string ticket = context.Request.QueryString["ticket"] ?? "";
                string signature = context.Request.QueryString["signature"] ?? "";

                SignOnClient ssoClient = new SignOnClient();
                ssoClient.ClientSignOut(ticket, signature);
            }
        }

        #endregion
    }
}
